@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Event
@using k8s.Models
@inherits BlazorApp.Pages.Common.DrawerPageBase<V1Ingress>
@if (Ingress != null)
{
    <IngressAction Item="Ingress" MenuMode="MenuMode.Horizontal"></IngressAction>
    <Divider Orientation="left" Style="font-weight:bold">@L["Metadata"]</Divider>
    <MetadataView Item="Ingress.Metadata" ExplainFieldPrefix="ingress"></MetadataView>
    <Divider Orientation="left" Style="font-weight:bold">@L["Spec"]</Divider>
    <HTable Bordered Column="1">
        <PropertySimpleView Title=@L["IngressClass"] Item="@Ingress.Spec.IngressClassName"
                            ExplainField="ingress.spec.ingressClassName">
        </PropertySimpleView>
        <IngressBackendView Title=@L["DefaultBackend"] Namespace="@Ingress.Namespace()"
                            Backend="@Ingress.Spec.DefaultBackend"
                            ExplainField="ingress.spec.ingressClassName">
        </IngressBackendView>
        <IngressRulesView Title=@L["Rules"] Namespace="@Ingress.Namespace()"
                          Rules="@Ingress.Spec.Rules">
        </IngressRulesView>
        <IngressTlsView Title=@L["TLS"] Tls="@Ingress.Spec.Tls"></IngressTlsView>
    </HTable>
    <Divider Orientation="left" Style="font-weight:bold">@L["Status"]</Divider>
    @if (Ingress.Status.LoadBalancer is not null)
    {
        <HTable Bordered Column="1">
            <PropertySimpleView Title=@L["LoadBalancer"] Item="@Ingress.Status.LoadBalancer"
                                ExplainField="ingress.status.loadBalancer" ShowInJson="true">
            </PropertySimpleView>
        </HTable>
    }

    <IngressBackendServicePodListView Ingress="@Ingress"></IngressBackendServicePodListView>

    <MiniEventListView Uid="@Ingress.Metadata.Uid"></MiniEventListView>
}
